#include <iostream>
using namespace std;

#include <stack>

class Point
{
public:
    Point(int x, inty) : m_x(x), m_y(y) {}

public:
    void display()
    {
        cout << "(" << m_x << "," << m_y << ")" << endl;
    }

public:
    int m_x;
    int m_y;
};

int main()
{
#if 0
    stack<int> mystack;

    /*压栈*/
    mystack.push(5);
    mystack.push(2);
    mystack.push(7);
    mystack.push(1);
    mystack.push(3);

    /*查看栈顶元素*/
    cout << "top:" << mystack.top() << endl;

    /*弹出栈顶元素*/
    mystack.pop();

    /*查看栈顶元素*/
    cout << "top:" << mystack.top() << endl;

    /*查看元素个数*/
    cout << "size:" << mystack.size() << endl;

    stack<int> mystack2;
    mystack2.push(11);
    mystack2.push(22);
    mystack2.push(33);
    mystack2.push(44);
    mystack2.push(55);

    /*栈交换*/
    mystack.swap(mystack2);

    cout << "size:" << mystack.size() << endl;

    while (!mystack.empty())
    {
        cout << "top:" << mystack.top() << endl;
        /*弹出栈顶元素 */
        mystack.pop();
    }

    mystack.emplace(555);
#endif

    stack<Point> mystack3;
    mystack3.emplace(Point(1, 1));
    mystack3.emplace(Point(2, 2));
    mystack3.emplace(Point(3, 3));
    mystack3.emplace(Point(4, 4));

    /*查看栈的元素个数*/
    cout<<"size:"<<mystack3.size()<<endl;

    mystack3.top().display();


    return 0;
}